import { Radio } from 'antd';
import './style.less'

export default function CustomTabs(props: { tabs: any[], onChange: any, curTab: string }) {
    const { tabs, onChange, curTab } = props;

    return (
        <Radio.Group onChange={(e) => { onChange(e?.target?.value) }} value={curTab} className={`process-designer-custom-tabs-wrapper ${tabs?.length == 1 ? 'one' : ''}`}>
            {
                tabs?.map((item: { value: string; label: string; disabled: boolean}) => {
                    return (
                        <Radio.Button value={item?.value} key={item?.value} disabled={item?.disabled}>{item?.label}</Radio.Button>
                    )
                })
            }
        </Radio.Group>
    )
};